document.addEventListener('DOMContentLoaded', function(){
    var likesbtn = document.getElementById('likes-btn')
    var likesum = document.getElementById('likesum')
    likesbtn.addEventListener('click', function(){
        fetch('/images/likes/' + likesbtn.dataset.imageid,
        {method: 'POST', body: {}}).then(response => response.json())
        .then(resp => {
            console.log(resp)
            likesum.innerHTML = resp.likes
        })
    })
})